<template>
  <div class="dialog" v-show="showMask">
    <div class="dialog-container">
      <div class="btns">
        <div class="title">删除设备</div>
        <!-- <div
          class="timerBtnContainer"
          v-for="(item, key) in timerList.list"
          :key="key"
          @click="clickItem(key)"
        >
          <div class="timeBtn">
            <div class="left">{{ item.name }}</div>
            <div class="center">
              {{ getDefaultText(key) }}
            </div>
            <img class="right" :src="getSelectImg(key)" />
          </div>
          <div class="divider"></div>
        </div> -->
        <div class="message">
          此操作会删除手机中有关该设备的所有信息，删除设备后，若再次使用，需要重新添加。
        </div>
        <div class="cancelContainer">
          <div class="confirm" @click="clickConfirm">{{ confirmText }}</div>
          <div class="divider"></div>
          <div class="cancel" @click="clickCancel">{{ cancelText }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    value: false,
    timerList: {},
    cancelText: {
      type: String,
      default: "取消",
    },
    confirmText: {
      type: String,
      default: "确定",
    },
    bottom: {
      type: Number,
      default: 405,
    },
  },
  data() {
    return {
      showMask: false,
    };
  },
  computed: {},
  methods: {
    closeMask() {
      this.showMask = false;
    },
    clickConfirm() {
      this.$emit("confirm");
      this.closeMask();
    },
    clickCancel() {
      this.$emit("cancel");
      this.closeMask();
    },
  },
  mounted() {
    this.showMask = this.value;
  },
  watch: {
    value(newVal, oldVal) {
      this.showMask = newVal;
    },
    showMask(val) {
      this.$emit("input", val);
    },
  },
};
</script>
<style lang="less" scoped>
.dialog {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  .dialog-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    // .btnsShow {
    //   transform: translateY(0%);
    // }
    .btns {
      border-radius: 16px;
      box-shadow: 0px 8px 18px rgba(0, 0, 0, 0.25);
      width: 100%-6px;
      height: 200px;
      display: flex;
      flex-direction: column;
      margin-bottom: 10px;
      background: rgba(255, 255, 255, 1);
      // transition: all 0.3s ease;
      // transform: translateY(20%);
      .title {
        font-size: 20px;
        color: rgba(0, 0, 0, 1);
        margin-top: 25px;
        margin-left: 24px;
        margin-bottom: 21px;
      }
      .message {
        margin-left: 24px;
        margin-right: 24px;
        font-size: 16px;
        color: #000000;
      }

      .cancelContainer {
        margin-top: 16px;
        margin-left: 24px;
        margin-right: 24px;
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        .cancel {
          font-size: 16px;
          color: #0a59f7;
        }
        .confirm {
          font-size: 16px;
          color: #0a59f7;
        }
        .divider {
          height: 24px;
          width: 1px;
          background: rgba(0, 0, 0, 0.2);
        }
      }
    }
  }
}
</style>
